#ifndef EDITBOOKWINDOW_H
#define EDITBOOKWINDOW_H

#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QMessageBox>
#include <QCheckBox>
#include "database.h"

class EditBookWindow : public QDialog
{
    Q_OBJECT

public:
    explicit EditBookWindow(const QString &bookId, Database *db, QWidget *parent = nullptr);
    ~EditBookWindow();

private slots:
    void onEditClicked();
    void onCancelClicked();

private:
    void setupUI();
    void createConnections();
    void loadBookInfo();

    QString bookId;
    Database *db;
    QLineEdit *titleEdit;
    QLineEdit *authorEdit;
    QLineEdit *publisherEdit;
    QCheckBox *availableCheckBox;
    QPushButton *editButton;
    QPushButton *cancelButton;
};

#endif // EDITBOOKWINDOW_H 
